package cn.tedu._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator {
    @Override
    public int add(int x, int y) {
        /*
        if(x>0){
            throw new RuntimeException("参数x不能为正数");
        }

         */
        int resuly = x + y;
        System.out.println("方法内部");
        return resuly;
    }

    @Override
    public int sub(int x, int y) {
        int resuly = x - y;
        System.out.println("方法内部");
        return resuly;
    }

    @Override
    public int mul(int x, int y) {
        int resuly = x * y;
        System.out.println("方法内部");
        return resuly;
    }

    @Override
    public int div(int x, int y) {
        int resuly = x / y;
        System.out.println("方法内部");
        return resuly;
    }
}
